﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master"
    AutoEventWireup="true" CodeBehind="AddCatagory.aspx.cs" Inherits="HRM.UI.HRManagerUI.Configuration.AddCatagory" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Employee/AddEmployeeCss.css" rel="stylesheet" type="text/css" />
    <link href="../../../Styles/Configuration/AddEmployeeCss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

        function CheckField() {
            if (document.getElementById("<%=txtAddCatagory.ClientID%>").value == "") {
                alert("You Have Missed a Catagory Name.");
                document.getElementById("<%=txtAddCatagory.ClientID%>").focus();
                return false;
            }
            return true;
        }       

    </script>
    <fieldset>
        <legend>Add New Category</legend>
        <table class="AddCatagoryTB" align="center">
            <tr>
                <td colspan="2" class="msgLabeltd">
                    <p class="msgTxt">
                        <asp:Label runat="server" ID="msgLabel"></asp:Label></p>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Category Name
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtAddCatagory" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                </td>
                <td class="Field">
                    <input type="submit" runat="server" id="addCatagoryName" value="Add Catagory" class="btnCss"
                        onserverclick="SaveCatagory" onclick="return CheckField()" />
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>List of categories</legend>
        <div align="center">
            <asp:GridView runat="server" ID="EmpCatagoryGridview" AutoGenerateColumns="False"
                OnRowCancelingEdit="EmpCatagoryGridview_RowCancelingEdit" OnRowEditing="EmpCatagoryGridview_RowEditing"
                OnRowUpdating="EmpCatagoryGridview_RowUpdating" CssClass="GridviewStyle" OnRowDeleting="EmpCatagoryGridview_RowDeleting"
                OnPageIndexChanging="EmpCatagoryGridview_PageIndexChanging" PageSize="3" AllowPaging="True"
                Width="70%"  BorderColor="#CCCCCC" BorderStyle="None" 
                BorderWidth="1px" CellPadding="3">
                <Columns>
                    <asp:TemplateField Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="txtId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Employee Catagory">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("EmpCatagory") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtCatagory" runat="server" Text='<%# Bind("EmpCatagory") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" HeaderText="Edit" />
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%# Bind("Id")%>'
                                CommandName="Delete" Text="Delete" OnClientClick="return confirm('Do you want to delete?')">
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle  CssClass="GridViewFooterStyle" />
                <HeaderStyle CssClass="GridViewHeaderStyle"/>
                <PagerStyle CssClass="GridViewFooterStyle" HorizontalAlign="center" />
                
            </asp:GridView>
        </div>
    </fieldset>
</asp:Content>
